define(function (require, exports, module) {

    // 公用第三方组件
    var $ = require('jquery');
    var angular = require('angular');
    require('angular-route');
    require('angular-messages');


    //公用自定义组件
    require('ngPublicUI');
    require('js/angular_interceptor');

    // 业务相关services、directives
    // require('js/services/services');
    // require('js/directives/directives');

    // 业务模块
    // require('business_modules/material/material');
    // require('business_modules/mass_message/mass_message');
    // require('business_modules/auto_reply/auto_reply');
    // require('business_modules/custom_menu/custom_menu');
    require('business_modules/thirdparty/join');


    var app = angular.module("wxApp", [
        'ngRoute', 
        'ngPublicUI', 
        'ngInterceptor',
        // 'angularFileUpload',    
        // 'material', 
        // 'mass-message', 
        // 'autoReply', 
        // 'customMenu',
        'thirdParty'
    ]);
    app.constant('limit',10);
    app.constant('apife','/api/');
    app.constant('apibe','index.php?r=');

    app.config(function ($routeProvider) {
        $routeProvider
            .otherwise({
                redirectTo: '/thirdparty'
            });
    });
    app.controller('navController',['$scope','$location',function($scope,$location){
        $scope.isSelected = function(nav){
            return $location.$$path.indexOf('/' + nav) == 0;
        }
    }])
    app.run(['http', function (http) {
        // 获取登录用户信息
        http.get('site/userinfo')
            .success(function(data, status, headers, config) {
                $('#js_user_name').text(data.data.name);
            })
    }]);
    //app.controller("material",function(){
    //
    //});
    angular.bootstrap(document.documentElement, ['wxApp']);
});
